package com.tyk.bookstore.back.storage.repository;


import com.tyk.bookstore.back.common.dal.mapper.IMapper;
import com.tyk.bookstore.back.storage.model.entity.StockDo;
import com.tyk.bookstore.back.storage.model.query.StockDeleteQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author tyk
 * @description 库存管理
 */
@Mapper
public interface StockRepository extends IMapper<StockDo> {

    /**
     * 统计符合条件的库存的数量
     */
    Long countByStockDeleteQueryList(@Param("qs") List<StockDeleteQuery> qs);

    /**
     * 批量删除库存
     */
    void deleteBatchByStockDeleteQueryList(@Param("qs") List<StockDeleteQuery> qs);

    /**
     * 添加库存
     */
    void updateByWarehouseIdAndBookId(@Param("stock") StockDo stock);
}
